<?php
/**
 * @author Pawel Giemza
 * @version 1.2
 * @package Arrow
 * @subpackage Orm
 * @link http://arrowplatform.org/
 * @copyright 2011 3code 
 * @license GNU LGPL
 * 
 * @date 2011-05-01 
*/



class ArrowOrmCriteria implements IArrowBaseCriteria{

//constructor	
public function __construct(){}


public static function Create(){}
	
//-------- Field Management methods ----------------
// 
public function addField($field, $alias, $aggregate ){}

public function addFieldSnippet($code, $alias){} // ("count( {Product/id} )  ", 'cnt');


public function addFields( $field, ... ){} //->addFields( "aa" => "adasd", "bbbb" => "asdad", "adsas" );
public function replaceField( $alias, $name, $aggregate ){} //inversed argument order
public function removeField($alias){}
public function clearFieldList($modelNamespace='',$leave='required'){}

//-------- Condition Management methods ----------------
public function replaceCond($conditionId, $Field, $value, $conditionType){}
public function removeCond($conditionId){}

public function addOr( $column, $value, $condition = self::C_EQUAL );
public function addOrSub( IBaseCriteria $criteria );
public function addOrSnipped( $code );  // ("replace(  {Product/id} ,'aaa','bbb' )  = 'bbb' ");
        
public function addAnd( $column, $value, $condition = self::C_EQUAL ) ;
public function addAndSub( IBaseCriteria $criteria );
public function addAndSnipped( $code );  // ("replace(  {Product/id} ,'aaa','bbb' )  = 'bbb' ");



//-------- Group/Order/Limit Management methods ----------------
//Order => Sort
public function addOrder($alias, $sortDirection){}
public function addOrderSnippet( $code );  // order by rand()
public function removeOrder($alias=''){} //empty alias => remove all

public function addGroup($alias){}
public function addOrderSnippet( $code );  // group by 123
public function removeGroup($alias=''){} //empty alias => remove all

public function addLimit($limit, $offset = 0 ){}
public function removeLimit(){} //empty alias => remove all

//-------- Relation Management methods ----------

/**
 * 
 * Registers model to be used (joined) in this criteria. It cam be accesed by calling its namespace
 * eg
 * register('shop.ShopProduct','Product')
 * addField('Product::name'); addField(array('Product','name')); 
 * @param unknown_type $model
 * @param unknown_type $namespace
 */

public function addModels($model, ...){} // addModels( "model.model1" => "aaa", "model.model231231" => "bbbb"));

public function addRealation($namespace1,$value1,$namespace2,$value2);
public function removeRelation($namespace1,$namespace1); 

//-------- Sting notation (serialization) methods ----------
// serialize/unserialize ??
public function serialize(){}
public function unserialize(){}

//-------- Data Access methods ----------
//java style ??
public function getFields(){}
public function getConditions(){}
public function getOrder(){}
public function getGroup(){}
public function getLimit(){}
public function getModels(){}
public function getRelations(){}

//-------- Helper methods ---------- 

public function isAggregated(){}
public function isGrouped(){}

}
?>